package com.yanfan.jt808.bean;

import java.nio.charset.Charset;

public class Const {

	//默认字符集为GBK
	public static final Charset DEFAULT_CHARSET = Charset.forName("GBK");

	//消息分隔符
	public static final byte PKG_DELIMITER = 0x7e;

	// 终端应答
	public static final short TERNIMAL_RESP_COMMON_ = 0x0001; //通用应答

	// 终端消息分类
	public static final short TERNIMAL_MSG_HEARTBEAT = 0x0002; //心跳
	public static final short TERNIMAL_MSG_REGISTER = 0x0100; //注册
	public static final short TERNIMAL_MSG_LOGOUT = 0x0003;//注销
	public static final short TERNIMAL_MSG_AUTH = 0x0102;//鉴权
	public static final short TERNIMAL_MSG_LOCATION = 0x0200;//位置
	public static final short TERNIMAL_MSG_LOCATION_BATCH = 0x0704;//批量位置上报
	public static final short TERNIMAL_MSG_STATUS = 0x0900;//位置数据上行透传

	//报警命令ID
	public static final short ALARM_COMMAND_INFORMED = 0xFA;// 报警命令ID及描述附表
	public static final short ALARM_COMMAND_EXTEND = 0xEB;// 轿车扩展数据流
	public static final short ALARM_COMMAND_BASICS = 0xEA;// 基础数据流附表
	public static final short ALARM_COMMAND_TRUCK = 0xEC;// 火车扩展数据流

	//数据上行透传消息体
	public static final short STATUS_MSG_FLAMEOUT =0xF1;//	驾驶行程数据(熄火发送)	驾驶行程数据包
	public static final short STATUS_MSG_FAULT =0xF2;//	故障码数据(状态改变发送)	故障码数据包
	public static final short STATUS_MSG_DORMANCY =0xF3;//	休眠进入(进入休眠模式发送)	休眠进入数据包
	public static final short STATUS_MSG_AWAKEN =0xF4;//	休眠唤醒(退出休眠模式发送)	休眠唤醒数据包
	//public static final short STATUS_MSG_DATA =0xF5;//	车辆GPS精简数据包(货车版)	暂时未加入
	//public static final short STATUS_MSG_FLAMEOUT =0xF6;//	MCU升级状态反馈包	MCU升级状态反馈包
	public static final short STATUS_MSG_COLLISION =0xF7;//	疑似碰撞报警描述包	疑似碰撞报警描述包

	//FA报警信息
	public static final short ALARM_COMMAND_SPEEDING = 0x0107;//超速报警
	public static final short ALARM_COMMAND_IDLING = 0x0106;//怠速报警
	public static final short ALARM_COMMAND_IGNITION = 0x0001;//点火上报
	public static final short ALARM_COMMAND_FLAMEOUT = 0x0002;//熄火上报
	public static final short ALARM_COMMAND_START = 0x0007;//系统启动
	public static final short ALARM_COMMAND_ABNORMAL_VIBRATION = 0x0115;//异常振动报警，类似于点火操作


	//服务器应答
	public static final short SERVER_RESP_COMMON = (short) 0x8001;//通用应答
	public static final short SERVER_RESP_REGISTER = (short) 0x8100;//注册应答

	//readerIdleTime
	public static final int IDLESTATE_HANDLER_READTIMEOUT = 15;
	//包头最大长度16+包体最大长度1023+分隔符2+转义字符最大姑且算60 = 1100
	public static final int MAX_FRAME_LENGTH = 2200;


	//_基础数据流   需要哪些数据，switch添加即可
	public static final short ALARM_COMMAND_0X0003 = 0x0003;//总里程数据 米
	public static final short ALARM_COMMAND_0X0004 = 0x0004;//总油耗数据 毫升
	public static final short ALARM_COMMAND_0X0005 = 0x0005;//总运行时长 秒
	public static final short ALARM_COMMAND_0X0006 = 0x0006;//总熄火时长 秒
	public static final short ALARM_COMMAND_0X0007 = 0x0007;//总怠速时长 秒
	public static final short ALARM_COMMAND_0X00010 = 0x0010;//加速度表
	public static final short ALARM_COMMAND_0X00011 = 0x0011;//车辆状态表
	public static final short ALARM_COMMAND_0X00012 = 0x0012;//车辆电压 0.1V
	public static final short ALARM_COMMAND_0X00013 = 0x0013;//终端内置电池电压 0.1V
	public static final short ALARM_COMMAND_0X00014 = 0x0014;// CSQ值 网络信号强度


	//轿车扩展数据流
	public static final short ALARM_COMMAND_0x60C0 = 0x60C0;//转速 精度：1偏移：0范围：0 ~ 8000
	public static final short ALARM_COMMAND_0x60D0 = 0x60D0;//车速 精度：1偏移：0范围：0 ~ 240
	public static final short ALARM_COMMAND_0x62F0 = 0x62F0;// 剩余油量 % L  剩余油量,单位L或% Bit15 ==0百分比%  OBD都为百分比==1单位L
	public static final short ALARM_COMMAND_0x6050 = 0x6050;//冷却液温度
	public static final short ALARM_COMMAND_0x60F0 = 0x60F0;//进气口温度 ℃
	public static final short ALARM_COMMAND_0x60B0 = 0x60B0;//进气(岐管绝对)压力 kPa
	public static final short ALARM_COMMAND_0x6330 = 0x6330;//大气压力 kPa
	public static final short ALARM_COMMAND_0x6460 = 0x6460;//环境温度 ℃
	public static final short ALARM_COMMAND_0x6490 = 0x6490;//加速踏板位置
	public static final short ALARM_COMMAND_0x60A0 = 0x60A0;//燃油压力
	public static final short ALARM_COMMAND_0x6014 = 0x6014;//故障码状态
	public static final short ALARM_COMMAND_0X6010 = 0X6010;//故障码个数
	public static final short ALARM_COMMAND_0x6100 = 0x6100;//空气流量
	public static final short ALARM_COMMAND_0x6110 = 0x6110;//绝对节气门位置
	public static final short ALARM_COMMAND_0x61F0 = 0x61F0;//自发动机起动的时间
	public static final short ALARM_COMMAND_0x6210 = 0x6210;//故障行驶里程
	public static final short ALARM_COMMAND_0x6040 = 0x6040;//计算负荷值
	public static final short ALARM_COMMAND_0x6070 = 0x6070;//长期燃油修正(气缸列1和3)
	public static final short ALARM_COMMAND_0x60E0 = 0x60E0;//第一缸点火正时提前角
	public static final short ALARM_COMMAND_0x6901 = 0x6901;//前刹车片磨损 0 正常/否则  显示对应数据,单位：级
	public static final short ALARM_COMMAND_0x6902 = 0x6902;//后刹车片磨损 0 正常/否则  显示对应数据,单位：级
	public static final short ALARM_COMMAND_0x6903 = 0x6903;//制动液液位
	public static final short ALARM_COMMAND_0x6904 = 0x6904;//机油液位 mL 显示值为上传值/1000 单位 毫米
	public static final short ALARM_COMMAND_0x6905 = 0x6905;//胎压报警 0：当前无警告    1：存在胎压失压
	public static final short ALARM_COMMAND_0x6906 = 0x6906;//冷却液液位
	public static final short ALARM_COMMAND_0x6907 = 0x6907;//续航里程


	//货车扩展数据流  6部分与轿车类似
	public static final short ALARM_COMMAND_0x5001 = 0x5001;//离合器开关  0x00/0x01  关/开
	public static final short ALARM_COMMAND_0x5002 = 0x5002;//制动刹车开关 0x00/0x01  关/开
	public static final short ALARM_COMMAND_0x5003 = 0x6110;//驻车刹车开关  0x00/0x01  关/开
	public static final short ALARM_COMMAND_0x5004 = 0x61F0;//节流阀位置  精度：1偏移：0范围：0% ~ 100%
	public static final short ALARM_COMMAND_0x5005 = 0x5005;//油料使用率  精度：0.05L/h偏移：0取值范围：0 ~ 3212.75L／h   单位 L/h
	public static final short ALARM_COMMAND_0x5006 = 0x5006;//燃油温度   精度：0.03125℃偏移：-273.0℃范围：-273.0℃ ~ +1734.96875℃     单位  ℃
	public static final short ALARM_COMMAND_0x5007 = 0x5007;//机油温度   精度：0.03125℃偏移：-273.0℃范围：-273.0℃ ~ +1734.96875℃
	public static final short ALARM_COMMAND_0x5008 = 0x5008;//OBD发动机润滑油压力  精度：4偏移：0范围：0 ~ 1000kpa
	public static final short ALARM_COMMAND_0x5009 = 0x6901;//OBD制动器踏板位置  精度：1偏移：0范围：0% ~ 100%
	public static final short ALARM_COMMAND_0x500A = 0x6902;//OBD 空气流量  精度：0.1偏移：0取值范围：0~6553.5
	public static final short ALARM_COMMAND_0x62f0 = 0x62f0;//剩余油量,单位L或%Bit15 ==0百分比%  OBD都为百分 ==1单位L 显示值为上传值/10
	//能读取到以下数据
	public static final short ALARM_COMMAND_0x5105 = 0x5105;//反应剂余量 % 精度：0.4偏移：0范围：0% ~ 100%
	public static final short ALARM_COMMAND_0x5101 = 0x5101;//发动机净输出扭矩 % 精度：1偏移：-125取值范围：-125% ~+125%
	public static final short ALARM_COMMAND_0x5102 = 0x5102;// 摩擦扭矩 % 精度：1偏移：-125取值范围：-125% ~+125%
	public static final short ALARM_COMMAND_0x510A = 0x510A;//发动机扭矩模式   0：超速失效1：转速控制2：扭矩控制3：转速/扭矩控制9：正常
	public static final short ALARM_COMMAND_0x510C = 0x510C;//尿素箱温度 ℃ 精度：1℃偏移：-40.0℃范围：-40.0℃ ~ +210℃

	//新能源


}
